
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Medora.Model.Persons;

namespace Medora.Model.Institutions
{
    public class Provider:DeletedEntity
    {
        [Required]
        public string FirstName { get; set; }

        [Required]
        public string LastName { get; set; }

        [IgnoreDataMember]
        public string FullName
        {
            get
            {
                return string.Format("{0} {1}", LastName, FirstName);
            }
        }

        [Required]
        public string IDNP { get; set; }

        public Guid PersonId { get; set; }
        public virtual Person Person { get; set; }

        [ObjectRequired(ErrorMessage = "Department is required")]
        public Guid DepartmentId { get; set; }
        
        public virtual Department Department { get; set; }

        [ObjectRequired(ErrorMessage = "Speciality is required")]
        public Guid SpecialityId { get; set; }
        public virtual Speciality Speciality { get; set; }

         
        public Guid? PositionId { get; set; }
        public virtual Position Position { get; set; }

        public string ServiceRoom { get; set; }

        public Guid? SectorId { get; set; }
        public virtual Sector Sector { get; set; }
        
        public virtual ICollection<PersonProviderInstitution> PersonProviderInstitutions { get; set; }
    }

    public class ProviderView
    {
        public Guid Id { get; set; }
        public string IDNP { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string FullName { get { return string.Format("{0} {1}", FirstName, LastName); } }
        public string SpecialityTitle { get; set; }
    }
}